package cn.lanqiao.bigDate.entity.server;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.regex.Pattern;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Sys implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 服务器名称
     */
    private String computerName;

    /**
     * 服务器Ip
     */
    private String computerIp;

    /**
     * 项目路径
     */
    private String userDir;

    /**
     * 操作系统
     */
    private String osName;

    /**
     * 系统架构
     */
    private String osArch;

    /**
     * 系统文件夹
     * @param computerName
     */
    private String pathName;

    /**
     * 系统用户名
     * @param computerName
     */
    private String userName;

    /**
     * 处理器标识符
     */
    private String digit;



    public void setComputerName(String computerName) {
        this.computerName =computerName.substring(0,computerName.indexOf('/'));
    }

    public void setUserName(String userName) {
        this.userName = userName.substring(userName.lastIndexOf("\\Users\\")+7);
    }
}

